//
//  SZChannelModel.m
//  仿网易新闻
//
//  Created by made on 17/1/4.
//  Copyright © 2017年 made. All rights reserved.
//

#import "SZChannelModel.h"


@implementation SZChannelModel

- (NSString *) description
{
    return [self yy_modelDescription];
}


+ (NSArray *) channelList
{
    NSURL *jsonURL = [[NSBundle mainBundle] URLForResource:@"topic_news.json" withExtension:nil];
    
    //从服务器同步获取数据
    NSData *data = [NSData dataWithContentsOfURL:jsonURL];
    
    //获取频道的字典数组
    NSArray *channelDictArr = [[NSJSONSerialization JSONObjectWithData:data options:0 error:NULL] objectForKey:@"tList"];
    
    //字典转模型
    NSArray *modelArray = [NSArray yy_modelArrayWithClass:[SZChannelModel class] json:channelDictArr];
    
    return modelArray;
}


@end
